home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / SoundAndMusic / cmix / lpc / synthesis / allpole.c next >
C/C++ Source or Header  |  1991-12-11  |  660b  |  26 lines

  1. float allpole(x,jcount,npoles,past,c)
  2. float x,*past,*c;
  3. long  *jcount,npoles;
  4. {
  5.     int j,nfint;
  6.     for(j= *jcount, nfint=0;  nfint<npoles;  nfint++,j++)
  7.         x += (*(c+nfint) * *(past+j));
  8.     *(past+ *jcount) = *(past+*jcount+npoles) = x;
  9.     *jcount = (*jcount + 1) % npoles;
  10.     return(x);
  11. }
  12. float ballpole(x,jcount,npoles,past,c,out,nvals)
  13. float *x,*past,*c,*out;
  14. long  *jcount,npoles,nvals;
  15. {
  16.     register i,j,nfint;
  17.     register float temp;
  18.     for(i=0;i<nvals;++i){
  19.         temp = *x++;
  20.         for(j= *jcount, nfint=0;  nfint<npoles;  nfint++,j++)
  21.             temp += (*(c+nfint) * *(past+j));
  22.         *out++ =  *(past+ *jcount) = *(past+*jcount+npoles) = temp;
  23.         *jcount = (*jcount + 1) % npoles;
  24.         }
  25. }
  26.